home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio
/
Ham Radio CD-ROM (Emerald Software) (1995).ISO
/
ant
/
dish
/
parabola.bas
Wrap
BASIC Source File
|
1986-03-15
|
6KB
|
200 lines
10 ' PARABOLIC ANTENNA DESIGN PROGRAM
20 ' INCLUDES CALCULATION OF ANTENNA GAIN AND BEAMWIDTH
30 ' THE PICTORIAL DEFINITION OF TERMINOLOGY REQUIRES GRAPHICS CARD.
40 '
50 'AUTHOR: ALAN CHRISTIAN WA6YOB SACRAMENTO,CA
60 'VERSION: 1.0
70 'DATE: AUGUST 11,1984
80 '
90 ' THIS PROGRAM IS DISTRIBUTED FREE OF CHARGE VIA RBBS TO ANYONE
100 ' WHO WANTS TO USE IT. IT MAY BE FREELY COPIED BUT MAY NOT BE
110 ' SOLD. THE AUTHOR ASSUMES NO LIABILITY FOR THE FITNESS OF THIS
120 ' PROGRAM FOR ANY PURPOSE AND IS NOT LIABLE FOR DAMAGES OF ANY
130 ' SORT RESULTING FROM THE USE OF THIS PROGRAM.
140 '
150 ' THIS PROGRAM SHOULD BE DISTRIBUTED IN ITS ORIGINAL FORM. ANY
160 ' REVISIONS SHOULD BE APPENDED OR CONTAINED IN A SEPARATE FILE.
170 '
180 ' ***** INTRODUCTION AND INSTRUCTIONS *****
190 CLS
200 SCREEN 0,0,0,0
210 COLOR 7,0,0
220 GOSUB 1120
230 LOCATE 4,5:PRINT "PARABOLIC ANTENNA DESIGN PROGRAM VERSION 1.0"
240 LOCATE 6,5:PRINT "FOR USE IN DESIGNING PARABOLIC ANTENNA REFLECTORS. MAY"
250 LOCATE 7,5:PRINT "BE USED FOR AMATEUR RADIO APPLICATIONS (TX/RX) OR FOR"
260 LOCATE 8,5:PRINT "GEO-STATIONARY SATELLITE RECEPTION APPLICATIONS."
270 '
280 LOCATE 12,5:PRINT "THIS PROGRAM DESIGNS THE REFLECTOR ONLY. THE DESIGN OF"
290 LOCATE 13,5:PRINT "THE ANTENNA FEED (ILLUMINATION) SYSTEM IS NOT DISCUSSED."
300 LOCATE 15,5:PRINT "THE REFLECTOR MAY BE ILLUMINATED BY A HORN, DIPOLE, ETC."
310 LOCATE 17,5:PRINT "DO YOU WANT TO SEE A PICTORIAL DEFINITION OF THE TERMS "
320 LOCATE 18,5:PRINT "USED IN THE DESIGN? (NOTE: GRAPHICS CARD AND MONITOR"
330 LOCATE 19,5:PRINT "ARE REQUIRED. (Y/N)"
340 QQ$=INKEY$:IF QQ$="" THEN 340
350 IF QQ$="Y" OR QQ$="y" THEN GOSUB 1490:REM HI-RES GRAPHICS SUBROUTINE
360 ' ***** CALCULATION OF "DEPTH" OF REFLECTOR AT 1-INCH INTERVALS *****
370 CLS
380 PRINT:PRINT
390 INPUT "DIAMETER OF REFLECTOR IN FEET ";DF
400 INPUT "FOCAL LENGTH OF ANTENNA IN FEET";FF
410 DI=DF*12
420 FI=FF*12
430 YF=DF/2
440 YI=DI/2
450 DIM ZZ(DI,2)
460 FOR Y=1 TO YI
470 ZZ(Y,0)=Y
480 ZZ(Y,1)=(INT(Y^2/(4*FI)*100))/100
490 NEXT Y
500 ' ***** SELECT OUTPUT DEVICE *****
510 PRINT "DO YOU WANT RESULTS ON THE PRINTER (P) OR SCREEN (S)"
520 QQ$ = INKEY$:IF QQ$="" THEN 520
530 IF QQ$="P" OR QQ$="p" THEN 770
540 ' ***** OUTPUT TO VIDEO SCREEN *****
550 PC=0
560 CLS
570 PRINT "RADIAL DISTANCE (Y)";SPC(20);"DEPTH (Z)"
580 PRINT "INCHES FROM CENTER ";SPC(20);"IN INCHES"
590 PRINT "-------------------------------------------------"
600 LOCATE 4,1
610 PG=0:IF PC=1 THEN 630
620 FOR Q=0 TO YI
630 PRINT USING "#########";ZZ(Q,0);
640 PRINT SPC(25)
650 PRINT USING "######.##";ZZ(Q,1)
660 PG = PG+1:IF PG < 17 THEN 710
670 PRINT:PRINT "HIT ANY KEY TO CONTINUE"
680 QQ$=INKEY$:IF QQ$="" THEN 680
690 PC=1
700 GOTO 560
710 NEXT Q
720 PRINT "DO YOU WANT TO CALCULATE GAIN (Y/N)"
730 QQ$=INKEY$:IF QQ$="" THEN 730
740 IF QQ$="Y" OR QQ$="y" THEN 980
750 GOTO 1990
760 ' ***** OUTPUT TO PRINTER *****
770 PC=0
780 LPRINT CHR$(12)
790 LPRINT "RADIAL DISTANCE (Y)";SPC(20);"DEPTH (Z)"
800 LPRINT "INCHES FROM CENTER ";SPC(20);"IN INCHES"
810 LPRINT "-------------------------------------------------"
820 LPRINT
830 PG=0:IF PC=1 THEN 850
840 FOR Q=0 TO YI
850 LPRINT USING "#########";ZZ(Q,0);
860 LPRINT SPC(25)
870 LPRINT USING "######.##";ZZ(Q,1)
880 PG = PG+1:IF PG < 55 THEN 910
890 PC=1
900 GOTO 780
910 NEXT Q
920 LPRINT CHR$(12)
930 PRINT "DO YOU WANT TO CALCULATE GAIN (Y/N)"
940 QQ$=INKEY$:IF QQ$="" THEN 940
950 IF QQ$="Y" OR QQ$="y" THEN 980
960 GOTO 1990
970 ' ***** GAIN AND BEAMWIDTH CALCULATION *****
980 SCREEN 0,0,0,0:CLS:KEY OFF:WIDTH 80
990 PRINT "PARABOLIC ANTENNA GAIN AND BEAMWIDTH CALCULATION"
1000 PRINT
1010 K=.4342928
1020 INPUT "FREQUENCY IN MEGAHERTZ ";F
1030 D=DF
1040 G=(INT(20*(LOG(F)*K)+20*(LOG(D)*K)-52.6)*10)/10
1050 TH=(INT(70000000#/(F*D)))/1000
1060 PRINT
1070 PRINT "ANTENNA GAIN =";G;"DB OVER A POINT SOURCE (ISOTROPIC)"
1080 PRINT "BEAM ANGLE =";TH;"DEGREES"
1090 PRINT:PRINT
1100 GOTO 1990
1110 ' ***** PRINT THE FRAMES FOR THE INSTRUCTIONS *****
1120 LOCATE 2,1
1130 GOSUB 1280
1140 FOR PX=3 TO 9
1150 LOCATE PX,1:PRINT CHR$(186)
1160 LOCATE PX,74:PRINT CHR$(186)
1170 NEXT PX
1180 LOCATE 10,1
1190 GOSUB 1350
1200 FOR PX=11 TO 20
1210 LOCATE PX,1:PRINT CHR$(186)
1220 LOCATE PX,74:PRINT CHR$(186)
1230 NEXT PX
1240 LOCATE 21,1
1250 GOSUB 1420
1260 RETURN
1270 ' PRINT HORIZONTAL LINE WITH DOWNTURNED CORNERS
1280 PRINT CHR$(201);
1290 FOR PP=1 TO 72
1300 PRINT CHR$(205);
1310 NEXT PP
1320 PRINT CHR$(187)
1330 RETURN
1340 ' PRINT HORIZONTAL LINE WITH "T" CORNERS
1350 PRINT CHR$(204);
1360 FOR PP=1 TO 72
1370 PRINT CHR$(205);
1380 NEXT PP
1390 PRINT CHR$(185)
1400 RETURN
1410 ' PRINT HORIZONTAL LINE WITH UPTURNED CORNERS
1420 PRINT CHR$(200);
1430 FOR PP=1 TO 72
1440 PRINT CHR$(205);
1450 NEXT PP
1460 PRINT CHR$(188)
1470 RETURN
1480 ' ***** HI-RES GRAPHICS ROUTINE TO DISPLAY DESIGN TERMINOLOGY *****
1490 CLS
1500 KEY OFF
1510 SCREEN 2
1520 PSET (15,50)
1530 DRAW "L5;R10;L5;D100;L5;R10;"
1540 PSET (50,100)
1550 DRAW "U50;D100;U50;L10;R20;L10;U50;L5;R10;L5;D100;L5;R10;L5;U50;"
1560 FOR Y=-50 TO 50 STEP .1
1570 Z=Y*Y/30
1580 PSET (Z+50,Y+100)
1590 NEXT Y
1600 LOCATE 2,35
1610 PRINT "DESIGN OF A PARABOLIC REFLECTOR"
1620 LOCATE 3,35
1630 PRINT "PICTORIAL DEFINITION OF TERMS"
1640 LOCATE 5,40
1650 PRINT "Y= 0.5 Diameter of reflector"
1660 LOCATE 6,40
1670 PRINT "Z= Reflector 'depth' at point Y'"
1680 LOCATE 7,40
1690 PRINT "F= Design focal length"
1700 LOCATE 8,45
1710 PRINT "NOTE: F,Y are in feet"
1720 LOCATE 9,45
1730 PRINT " Z is in inches"
1740 LOCATE 8,8
1750 PRINT "--Z--"
1760 LOCATE 13,25
1770 PRINT "FOCAL POINT"
1780 PSET (170,100)
1790 CIRCLE (170,100),3
1800 FOR Q = 160 TO 70 STEP -1
1810 IF Q/4=INT(Q/4) THEN PSET (Q,100):GOTO 1830
1820 PRESET (Q,100)
1830 NEXT Q
1840 LOCATE 13,15
1850 PRINT " F "
1860 LOCATE 12,2
1870 PRINT " "
1880 LOCATE 14,2
1890 PRINT " "
1900 LOCATE 13,2
1910 PRINT "2Y"
1920 LOCATE 22,1
1930 PRINT "Scale exaggerated for clarity"
1940 LOCATE 23,1
1950 PRINT "Hit any key to continue"
1960 KK$=INKEY$:IF KK$="" THEN 1960
1970 SCREEN 0:CLS
1980 RETURN
1990 CLEAR:END